// JavaScript Document
//左侧折叠菜单
var jun={
	$:function(id){
		return typeof id === "object" ? id:document.getElementById(id)
	},
	$$:function(tagName,oParent){
		return(oParent||document).getElementsByTagName(tagName)
	}
}
function subNav(){
	var obj = jun.$("siderbar"),
		oLi = jun.$$("h4",obj),
		oConDiv = jun.$$("div",obj);
	//默认全部收起	
	for(var i = 0;i <oConDiv.length;i++){
		oConDiv[i].style.display = "block";
	}
	for (var i = 0;i<oLi.length;i++) {
    	oLi[i].onclick = function () {	
			var oDiv = this.nextSibling,
				oIcon = this.lastChild;
			while(oDiv.nodeType!=1) oDiv = oDiv.nextSibling;
			while(oIcon.nodeType!=1) oIcon = oIcon.previousSibling;
			oIcon.className = oIcon.className == "" ? "minus" : "";
			oDiv.style.display = oDiv.style.display == "none" ? "block" : "none";
		}
	}
}


